//
//  interperShiViewController.m
//  WheatPlan
//
//  Created by 王晨辉 on 15/6/29.
//  Copyright (c) 2015年 IOSTeam. All rights reserved.
//

#import "interperShiViewController.h"

@interface interperShiViewController ()<UITableViewDataSource,UITableViewDelegate>{
    
    UITableView * _tableView;
    
}

@end

@implementation interperShiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.rowHeight = 50;
    [self.view addSubview:_tableView];
    
}
#pragma mark--- tableViewDelegate 每个区的行数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}

#pragma mark--- tableViewDelegate 区尾的高度

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    
    return 0;
    
}
#pragma mark--- tableViewDelegate cell

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *NOTIFY = @"cell";
    //    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:NOTIFY];
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    
    if (cell==nil) {
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NOTIFY];
        
        //  int a =  self.navigationController.navigationBar.frame.size.height+20;
        UILabel * ParentLab = [[UILabel alloc]initWithFrame:CGRectMake(30, 0, SCREEN_WIDTH/4*3-10, 87/2)];
        ParentLab.text = @"评测日期：2015-03-06评测日期：2015-03-06评测日期：2015-03-06评测日期：2015-03-06评测日期：2015-03-06";
        ParentLab.font = [UIFont systemFontOfSize:12];
        ParentLab.textAlignment = NSTextAlignmentLeft;
        ParentLab.numberOfLines = 2;
        [cell addSubview:ParentLab];
        
        
        ////NSLog(@"%ld",(long)indexPath.section);
        
        UILabel * numberLab = [[UILabel alloc]initWithFrame:CGRectMake(9, 9, 20, 10)];
        numberLab.text = [NSString stringWithFormat:@"%ld.",(long)indexPath.section+1] ;
        numberLab.font = [UIFont systemFontOfSize:12];
        numberLab.textAlignment = NSTextAlignmentLeft;
        [cell addSubview:numberLab];
        
        
        UIButton * typBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [typBtn addTarget:self action:@selector(rightBtnClick) forControlEvents:UIControlEventTouchUpInside];
        [typBtn setBackgroundImage:[UIImage imageNamed:@"6.png"] forState:UIControlStateNormal];
        typBtn.frame = CGRectMake(SCREEN_WIDTH/4*3+(SCREEN_WIDTH/4-30)/2, (87/2-30)/2, 30, 30);
        [cell addSubview:typBtn];
        
        _tableView.separatorStyle = UITableViewCellEditingStyleNone;
        
        UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, _tableView.rowHeight-1, SCREEN_WIDTH, 1)];
        view.backgroundColor = UIColorWithRGBA(229, 229, 231, 1);
        [cell addSubview:view];
        
    }
    
    
    
    
    
    
    
    return cell;
    
    
    
    
    
}
-(void)rightBtnClick{
    
    
    
    
}
#pragma mark--- tableViewDelegate 有几个区
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 20;
    
}
#pragma mark--- tableViewDelegat 点击方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
